<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'admin_name'       => 'require',
        'admin_tel'       => 'require',
        'admin_password'       => 'require',
        'role_id'       => 'require',
        'id'       => 'require',
    ];

    protected $message = [
        'admin_name.require'       => '名称不能为空',
        'admin_tel.require'       => '手机号不能为空',
        'admin_password.require'       => '密码不能为空',
        'role_id.require'       => '角色不能为空',
        'id.require'       => '没有发现ID',
    ];

    protected $scene = [
        'add'  =>  ['admin_name', 'admin_tel', 'admin_password'],
        'del'  => ['id'],
        'edit' => ['id', 'admin_name', 'admin_tel', 'admin_password'],
    ];
}